from abc import ABC, abstractmethod
from fastapi import UploadFile

from ...pojo.dto import (
    UserKnowledgeBaseDTO,
    KnowledgeHeaderDTO,
    EmbeddingSearchParamsDTO,
    UpdateImageInfoDTO,
)


class UserKnowledgeBaseService(ABC):
    @abstractmethod
    async def createKnowledgeBase(self, userKnowledgeBaseDTO: UserKnowledgeBaseDTO): ...

    @abstractmethod
    async def getKnowledgeBaseListByUserId(self, userId: int): ...

    @abstractmethod
    async def updateKnowledgeBaseNameByKnowledgeBaseId(
        self, knowledgeBaseId: int, name: str
    ): ...

    @abstractmethod
    async def deleteKnowledgeBaseByKnowledgeId(self, knowledgeBaseId: int): ...

    @abstractmethod
    async def upload(self, file: UploadFile, knowledgeHeader: KnowledgeHeaderDTO): ...

    @abstractmethod
    async def search(self, embeddingSearchParamsDTO: EmbeddingSearchParamsDTO): ...

    @abstractmethod
    async def getImages(self, knowledgeBaseId: int, count: int): ...

    @abstractmethod
    async def updateImageInfo(self, imageInfo: UpdateImageInfoDTO): ...
